package com.dd.ms.provider.web.service.rpc;

import com.dd.ms.provider.api.DataObjectRpcApi;
import com.dd.ms.provider.pojo.DataObjectBO;
import com.dd.ms.provider.web.converter.DataObjectConverter;
import com.dd.ms.provider.web.respository.DataObjectRepository;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * @Author liuxianmeng
 * @CreateTime 2025/6/22 18:15
 * @Description 类功能作用说明
 */
@Service
@RequiredArgsConstructor
@DubboService(interfaceClass = DataObjectRpcApi.class, group = "DUBBO_DD_MS_PROVIDER", version = "1.0")
public class DataObjectRpcServiceImpl implements DataObjectRpcApi {

    private final DataObjectRepository dataObjectRepository;

    @Override
    public DataObjectBO getOneById(Long id) {
        return DataObjectConverter.convert2BO(dataObjectRepository.getOne(id));
    }
}
